package com.huluobo.base.mvvm;

import androidx.lifecycle.ViewModel;

/**
 * Created by LC on 2024/8/15.
 */
public abstract class BaseViewModel<Repo extends BaseRepo> extends ViewModel {
    protected Repo repo;

    public BaseViewModel() {
        repo = createRepo();
    }

    //每一个ViewModel都需要有个对应的Repo,比如:LoginViewModel,需要有一个对应的LoginRepo来存放请求方法
    protected abstract Repo createRepo();

}
